<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<title>新增收支类别</title>
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/public.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/sorttable.js"></script>
		<script language="JavaScript" src="${pageContext.request.contextPath}/js/public.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/date1.js"></script>
			<script  language="JavaScript"
			src="${pageContext.request.contextPath}/js/validate.js"></script>
		<script type="text/javascript">
	  	function validate(){	
			var incomeExpenseCode = document.getElementById("incomeExpenseCode");
			var incomeExpenseName = document.getElementById("incomeExpenseName");
			var incomeExpenseDesc = document.getElementById("incomeExpenseDesc");
			var accountBookName = document.getElementById("accountBookName");
			
					
			if(!isNotNull(incomeExpenseCode,'代码')||!f_check_ZhOrNumOrLett(incomeExpenseCode,'代码')||!f_check_stringLength(incomeExpenseCode,'代码',12))
				return false ;				
			if(!(isNotNull(incomeExpenseName,'名称')&&f_check_ZhOrNumOrLett(incomeExpenseName,'名称')&&f_check_stringLength(incomeExpenseName,'名称',12)))
				return false ;	
			if(!(isNotNull(incomeExpenseDesc,'全名')&&f_check_NumOrLett(incomeExpenseDesc,'全名')&&f_check_stringLength(incomeExpenseDesc,'全名',12)))
				return false ;	
			if(!(isNotNull(accountBookName,'会计科目')&&f_check_ZhOrNumOrLett(accountBookName,'会计科目')))
				return false ;	
		} 
		</script>

</head>

<body >
		<div  align="center" id="info_all" style="width:372px;" >
			<div id="info_top">
				新增收支类别
			</div>
				<div  style="padding:4px;width:360px;margin-top:6px;">
				<s:form action="addIncomeExpense" onsubmit="return validate();" theme="simple">
					<table style="margin-top:10px;background:#fbfbfb;color:#403040;" align="center">
							<tr>
				<td width="40px">代码</td>
				<td><input type="text" name="incomeExpenseCode" id="incomeExpenseCode" size="12"/></td>
				<td width="40px">名称</td>
				<td><input type="text" name="incomeExpenseName" id="incomeExpenseName" size="12"/></td>
			</tr>
			<tr>
				<td width="40px">全名</td>
				<td><input type="text" name="incomeExpenseDesc" id="incomeExpenseDesc" size="12"/></td>
				<td width="40px">科目</td>
				<td>
				<s:hidden name="accountbookId" id="accountbookId"></s:hidden>
						<s:textfield name="accountBookName" size="12" id="accountbookName" readonly="true"> </s:textfield>
						<img src="images/kookup.gif" style="cursor:pointer" onclick="openWin('selectAccountbook.action','accountbook',750,700,0)">
					
				</td>			
			</tr>	
			<tr>
				<td width="40px"  >类别</td>
			<td><s:select list="#{'1':'支出','0':'收入'}" name="incomeExpenseType" ></s:select></td>
			<td width="40px" ></td>
				<td></td>
			
			</tr>	
						<tr>
							<td colspan="2">
							<div style="margin:6px;text-align:right;">
					<input type="submit" value="保存"  onFocus="this.blur()"
						onmouseover="this.className='btnover'"
						onmouseout="this.className='btnout'" class="btnsize" />
				
							</div>
							</td>
							<td colspan="2">
							<div style="margin:6px;text-align:left;">
					
					<input type="button" value="返回" onclick="history.go(-1)" onFocus="this.blur()"
						onmouseover="this.className='btnover'"
						onmouseout="this.className='btnout'" class="btnsize" />
							</div>
							</td>
						</tr>
					</table>
					</s:form>
			</div>	

</body>
</html>